package com.yueka.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yueka.pojo.entity.experience.Experience;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ExperienceMapper extends BaseMapper<Experience> {
    @Select("SELECT id, date, experience_name, content, status, update_time, create_time FROM experience")
    List<Experience> list();

    @Update("UPDATE experience SET date = #{date}, experience_name = #{experienceName}, content = #{content}, status = #{status}, update_time = #{updateTime} WHERE id = #{id}")
    void update(Experience experience);

    @Delete("DELETE FROM experience WHERE id = #{id}")
    void delete(Integer id);

    @Select("SELECT id, date, experience_name, content, status, update_time, create_time FROM experience WHERE status = 1")
    List<Experience> weblist();
}
